package com.thread;

class ThreadTest1 extends Thread {
    Object o1;
    Object o2;

    public ThreadTest1(Object o1, Object o2) {
        this.o1 = o1;
        this.o2 = o2;
    }

    public void run() {
        synchronized (o1) {//锁住o1，五秒后醒来，无法锁住o2，
            //o2在下面类中被锁住
            try {
                Thread.sleep(1000 * 5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            synchronized (o2) {

            }
        }
    }
}
